' CzList Internal functions. These functions have to be declared if you
' want to use them.
DECLARE FUNCTION CzGetWhatKindMem% ()
DECLARE FUNCTION CzItemsTagged% ()
DECLARE FUNCTION CzAllowTagging% (YesNo%)
DECLARE FUNCTION CzKeybTagScrolling% (YesNo%)
DECLARE FUNCTION CzMouTagScrolling% (YesNo%)
DECLARE FUNCTION CzSetVirtualPath% (PathToSet$)
' Demo functions
DECLARE SUB OpeningScreen ()
DECLARE SUB ShowThreeParts ()
DECLARE SUB AboutCzList ()
SUB AboutCzList ()
a$ = "CzList is a general listbox control for VBDOS. You can use it to display and list any kind of information. Each element in the listbox can be up to 63 characters long. It fully supports tagging and untagging."
a$ = a$ + CHR$(13) + CHR$(10)
a$ = a$ + CHR$(13) + CHR$(10) + "CzList will first try to use XMS Memory. If no XMS memory is available, it will try to use EMS Memory. If no XMS and no EMS memory is available, CzList will use the disk as virtual memory."
a$ = a$ + CHR$(13) + CHR$(10)
a$ = a$ + CHR$(13) + CHR$(10) + "Keep a close eye on the amount of conventional memory used during this demo. The amount of conventional memory used will not change no matter how many elements you put into CzList."
MSGBOX a$, 0, "CzList Demo"
END SUB
SUB chkAllowTag_Click ()
IF chkAllowTag.Value = 1 THEN
Result = CzAllowTagging(0)
Result = CzKeybTagScrolling(0)
Result = CzMouTagScrolling(0)
chkKeybTag.Enabled = -1
chkMouseTag.Enabled = -1
chkKeybTag.Value = 1
chkMouseTag.Value = 1
ELSE
Result = CzAllowTagging(1)
Result = CzKeybTagScrolling(1)
Result = CzMouTagScrolling(1)
chkKeybTag.Enabled = 0
chkMouseTag.Enabled = 0
END IF
END SUB
SUB chkKeybTag_Click ()
IF chkKeybTag.Value = 1 THEN
Result = CzKeybTagScrolling(0)
ELSE
Result = CzKeybTagScrolling(1)
END IF
END SUB
SUB chkMouseTag_Click ()
IF chkMouseTag.Value = 1 THEN
Result = CzMouTagScrolling(0)
ELSE
Result = CzMouTagScrolling(1)
END IF
END SUB
SUB cmdCancel_Click ()
' You must UNLOAD the form or control(s) before you end your program. CzList
' will then remove itself from memory. If you do not unload the form or
' control, the memory used by CzList (either XMS, EMS, or disk space) will
' not be released and unpredictable results may occur.
UNLOAD frmCzList
frmOrder.SHOW 1
END
END SUB
SUB cmdCzDir_Click ()
' You must UNLOAD the form or control(s) before you end your program. CzList
' will then remove itself from memory. If you do not unload the form or
' control, the memory used by CzList (either XMS, EMS, or disk space) will
' not be released and unpredictable results may occur.
UNLOAD frmCzList
frmDemoDir.SHOW 1
END SUB
SUB cmdTag_Click ()
' Tag all elements
' Value = 1 : tag alll elements in CzList
' Value = 2 : untag alll elements in CzList
CzList.Value = 1
' Display the number of items tagged.
lblItemsTagged.Caption = STR$(CzItemsTagged)
CzList.SETFOCUS
END SUB
SUB cmdUntag_Click ()
' Untag all elements
' Value = 1 : tag alll elements in CzList
' Value = 2 : untag alll elements in CzList
CzList.Value = 2
' Display the number of items tagged.
lblItemsTagged.Caption = STR$(CzItemsTagged)
CzList.SETFOCUS
END SUB
SUB CzList_DblClick ()
' Get the current element and display it.
' CzList.ListIndex is the current Index. You can also get any other
' index from 0 to ListCount. For example, to get element 189, use
' Dummy$ = CzList.List(188). Remember, the list starts with element 0.
SUB CzList_KeyDown (KeyCode AS INTEGER, Shift AS INTEGER)
' Display the current index.
lblListIndex.Caption = STR$(CzList.ListIndex)
' Display the number of items tagged.
lblItemsTagged.Caption = STR$(CzItemsTagged)
' The ENTER key was pressed. Get the current element and display it.
' CzList.ListIndex is the current Index. You can also get any other
' index from 0 to ListCount. For example, to get element 189, use
' Dummy$ = CzList.List(188). Remember, the list starts with element 0.
IF KeyCode = 13 THEN MSGBOX CzList.List(CzList.ListIndex), 0, "Pressed Enter Key"
END SUB
SUB CzList_MouseDown (Button AS INTEGER, Shift AS INTEGER, X AS SINGLE, Y AS SINGLE)
' Display the number of items tagged.
lblItemsTagged.Caption = STR$(CzItemsTagged)
END SUB
SUB CzList_MouseUp (Button AS INTEGER, Shift AS INTEGER, X AS SINGLE, Y AS SINGLE)
' Display the current index.
lblListIndex.Caption = STR$(CzList.ListIndex)
END SUB
SUB Form_Load ()
OpeningScreen
ShowThreeParts
AboutCzList
' You can force CzList to use a specific method of storage using the MODE
' property. Use it only if you really need it. By default, CzList will first
' try to use XMS memory. If no XMS memory is available, CzList will try to
' use EMS memory instead. If no EMS memory is available, CzList will then
' use the disk as virtual memory.
' If you force CzList to use XMS Memory, CzList will still try to use EMS
' memory if no XMS memory is available. If no EMS memory is available,
' CzList will use the disk.
'CzList.Mode = -1 ' where = -1 (Use XMS Memory)
' ' = -2 (Use EMS Memory)
' ' = -3 (Use Disk)
' If you force CzList to use EMS memory, do NOT run your program in the
' VBDOS environment as it will not work correctly. You have to compile
' your program into an EXE file.
'
' NOTE: The MODE property has to be set before you call any other CzList
' commands and before you load the form or control.
' The Max property tells CzList the maximum number of elements ever to
' be used. This simply means that during runtime you will never use
' more than Max of elements in the listbox. The default Max is 1023.
' You do not need to set the Max property if you are sure that you will
' never need more than 1024 elements. You can only set the Max property
' once. You should do this when your program first starts up or set the
' Max property in the Form Designer. Once the Max property has been set,
' it MUST not be changed during runtime.
'
' The default value is 1023. The maximum is 32765. 32765 elements require
' apx. 2.1 MBytes (XMS, EMS, or disk) whereas 1024 elements require apx.
' 65 KBytes (XMS, EMS, or disk).
Dummy$ = INPUTBOX$("How many elements (Starting with element 0) would you like to put into the ListBox control? Maximum # of elements is 32765 (starting with element 0). It will use either XMS or EMS memory, or diskspace. Enter -1 for no elements." _